<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>${channel.title} - ${site.title}</title>
  <meta name="keywords" content="${channel.seoKeywords}">
  <meta name="description" content="${channel.seoDescription}">
  <meta name="_csrf" content="${_csrf.token}"/>
  <meta name="_csrf_header" content="${_csrf.headerName}"/>
  [#include 'inc_meta.html'/]
  [#include 'inc_css.html'/]
  [#include 'inc_js.html'/]
  [#if config.greyStyle]
    <style>
      body {
        filter: grayscale(.95);
        -webkit-filter: grayscale(.95);
      }
    </style>
  [/#if]
</head>
<body>
[#include 'inc_header.html'/]

<div class="container mt-3">
  <div class="row">
    <div class="col-lg-12">
      <!-- 欠款总览 -->
      <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-money-bill-wave"></i> 欠款总览</h5>
          <button type="button" class="btn btn-primary" onclick="showPaymentModal()">
            <i class="fas fa-credit-card"></i> 在线缴费
          </button>
        </div>
        <div class="card-body">
          <div class="row text-center mb-4">
            <div class="col-md-3">
              <h3 class="text-danger">¥25.50</h3>
              <p class="text-muted">总欠款金额</p>
            </div>
            <div class="col-md-3">
              <h3 class="text-warning">3</h3>
              <p class="text-muted">待缴费项目</p>
            </div>
            <div class="col-md-3">
              <h3 class="text-info">1</h3>
              <p class="text-muted">逾期项目</p>
            </div>
            <div class="col-md-3">
              <h3 class="text-success">2</h3>
              <p class="text-muted">正常项目</p>
            </div>
          </div>

          <!-- 欠款分类统计 -->
          <div class="row">
            <div class="col-md-6">
              <div class="card text-center">
                <div class="card-body">
                  <i class="fas fa-clock fa-2x text-warning mb-2"></i>
                  <h6>超期罚款</h6>
                  <p class="text-danger font-weight-bold">¥15.00</p>
                </div>
              </div>
            </div>
            <div class="col-md-6">
              <div class="card text-center">
                <div class="card-body">
                  <i class="fas fa-tools fa-2x text-info mb-2"></i>
                  <h6>损坏赔偿</h6>
                  <p class="text-info font-weight-bold">¥10.50</p>
                </div>
              </div>
            </div>
            <div class="col-md-6">
              <div class="card text-center">
                <div class="card-body">
                  <i class="fas fa-book-dead fa-2x text-secondary mb-2"></i>
                  <h6>遗失赔偿</h6>
                  <p class="text-secondary font-weight-bold">¥0.00</p>
                </div>
              </div>
            </div>
            <div class="col-md-6">
              <div class="card text-center">
                <div class="card-body">
                  <i class="fas fa-ellipsis-h fa-2x text-muted mb-2"></i>
                  <h6>其他费用</h6>
                  <p class="text-muted font-weight-bold">¥0.00</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 欠款明细 -->
      <div class="card mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-list-alt"></i> 欠款明细</h5>
          <div class="btn-group btn-group-sm">
            <button type="button" class="btn btn-primary active" onclick="filterFines('all')">全部</button>
            <button type="button" class="btn btn-warning" onclick="filterFines('overdue')">逾期</button>
            <button type="button" class="btn btn-info" onclick="filterFines('damage')">损坏</button>
            <button type="button" class="btn btn-secondary" onclick="filterFines('other')">其他</button>
          </div>
        </div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-hover">
              <thead class="thead-light">
                <tr>
                  <th>
                    <div class="form-check">
                      <input class="form-check-input" type="checkbox" id="selectAll" onchange="toggleSelectAll()">
                      <label class="form-check-label" for="selectAll">全选</label>
                    </div>
                  </th>
                  <th>欠款类型</th>
                  <th>相关信息</th>
                  <th>金额</th>
                  <th>产生时间</th>
                  <th>缴款期限</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody id="fineList">
                <!-- 动态生成的欠款列表 -->
              </tbody>
            </table>
          </div>
          <div class="row mt-3">
            <div class="col-md-6">
              <div class="btn-group w-100">
                <button type="button" class="btn btn-custom btn-primary-custom" onclick="batchPay()">批量缴费</button>
                <button type="button" class="btn btn-custom btn-info-custom" onclick="exportFines()">导出明细</button>
              </div>
            </div>
            <div class="col-md-6 text-right">
              <small class="text-muted">已选择 <span id="selectedCount">0</span> 项，合计：<span id="selectedTotal">¥0.00</span></small>
            </div>
          </div>
        </div>
      </div>

      <!-- 违规记录 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-exclamation-triangle"></i> 违规记录</h5>
        </div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-hover">
              <thead class="thead-light">
                <tr>
                  <th>违规类型</th>
                  <th>违规时间</th>
                  <th>地点</th>
                  <th>处理结果</th>
                  <th>影响程度</th>
                  <th>当前状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody id="violationList">
                <!-- 动态生成的违规列表 -->
              </tbody>
            </table>
          </div>
        </div>
      </div>

      <!-- 信用状况 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-user-shield"></i> 信用状况</h5>
        </div>
        <div class="card-body">
          <div class="row text-center">
            <div class="col-md-4">
              <div class="card text-center">
                <div class="card-body">
                  <h3 class="text-primary">85</h3>
                  <p class="text-muted">当前信用分</p>
                </div>
              </div>
            </div>
            <div class="col-md-4">
              <div class="card text-center">
                <div class="card-body">
                  <h5 class="text-warning">B级</h5>
                  <p class="text-muted">信用等级</p>
                </div>
              </div>
            </div>
            <div class="col-md-4">
              <div class="card text-center">
                <div class="card-body">
                  <h3 class="text-info">-5</h3>
                  <p class="text-muted">本期变化</p>
                </div>
              </div>
            </div>
          </div>

          <div class="mt-4">
            <h6>权限影响</h6>
            <div class="row">
              <div class="col-md-6">
                <div class="alert alert-warning" role="alert">
                  <i class="fas fa-info-circle"></i>
                  <strong>可借册数限制：</strong> 5册（原10册）
                </div>
              </div>
              <div class="col-md-6">
                <div class="alert alert-warning" role="alert">
                  <i class="fas fa-info-circle"></i>
                  <strong>借阅期限缩短：</strong> 20天（原30天）
                </div>
              </div>
            </div>
            <div class="row mt-2">
              <div class="col-md-6">
                <div class="alert alert-info" role="alert">
                  <i class="fas fa-check-circle"></i>
                  <strong>特殊服务限制：</strong> 部分功能受限
                </div>
              </div>
              <div class="col-md-6">
                <div class="alert alert-success" role="alert">
                  <i class="fas fa-check-circle"></i>
                  <strong>预约优先级：</strong> 正常
                </div>
              </div>
            </div>
          </div>

          <div class="mt-4">
            <h6>恢复机制</h6>
            <div class="list-group">
              <div class="list-group-item d-flex justify-content-between">
                <span>信用恢复条件</span>
                <span class="badge badge-success">3个月无违规</span>
              </div>
              <div class="list-group-item d-flex justify-content-between">
                <span>预计恢复时间</span>
                <span class="badge badge-info">2024-07-15</span>
              </div>
              <div class="list-group-item d-flex justify-content-between">
                <span>加速恢复方法</span>
                <span class="badge badge-primary">参加图书馆志愿活动</span>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- 缴费提醒设置 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-bell"></i> 缴费提醒设置</h5>
        </div>
        <div class="card-body">
          <form id="reminderSettings">
            <div class="form-group">
              <label class="form-check">
                <input class="form-check-input" type="checkbox" id="dueReminder" checked>
                <label class="form-check-label" for="dueReminder">即将到期提醒（提前3天）</label>
              </label>
            </div>
            <div class="form-group">
              <label class="form-check">
                <input class="form-check-input" type="checkbox" id="overdueReminder" checked>
                <label class="form-check-label" for="overdueReminder">逾期提醒（逾期当天）</label>
              </label>
            </div>
            <div class="form-group">
              <label class="form-check">
                <input class="form-check-input" type="checkbox" id="severeOverdueReminder" checked>
                <label class="form-check-label" for="severeOverdueReminder">严重逾期提醒（逾期7天）</label>
              </label>
            </div>
            <div class="form-group">
              <label class="form-check">
                <input class="form-check-input" type="checkbox" id="monthlyReminder" checked>
                <label class="form-check-label" for="monthlyReminder">定期汇总提醒（每月）</label>
              </label>
            </div>
            <div class="text-center mt-3">
              <button type="button" class="btn btn-primary" onclick="saveReminderSettings()">
                保存设置
              </button>
            </div>
          </form>
        </div>
      </div>
      <!-- 支付方式 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-credit-card"></i> 支付方式</h5>
        </div>
        <div class="card-body">
          <div class="list-group">
            <a href="#" class="list-group-item list-group-item-action" onclick="selectPaymentMethod('campus')">
              <div class="d-flex justify-content-between">
                <div>
                  <i class="fas fa-graduation-cap fa-2x text-primary mr-3"></i>
                  <span>校园统一支付平台</span>
                </div>
                <span class="text-muted small">推荐</span>
              </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action" onclick="selectPaymentMethod('alipay')">
              <div class="d-flex justify-content-between">
                <div>
                  <i class="fab fa-alipay fa-2x text-info mr-3"></i>
                  <span>支付宝</span>
                </div>
                <small class="text-muted">支持</small>
              </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action" onclick="selectPaymentMethod('wechat')">
              <div class="d-flex justify-content-between">
                <div>
                  <i class="fab fa-weixin fa-2x text-success mr-3"></i>
                  <span>微信支付</span>
                </div>
                <small class="text-muted">支持</small>
              </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action" onclick="selectPaymentMethod('bank')">
              <div class="d-flex justify-content-between">
                <div>
                  <i class="fas fa-university fa-2x text-secondary mr-3"></i>
                  <span>银行卡支付</span>
                </div>
                <small class="text-muted">支持</small>
              </div>
            </a>
          </div>
        </div>
      </div>

      <!-- 常见问题 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-question-circle"></i> 常见问题</h5>
        </div>
        <div class="card-body">
          <div class="accordion" id="faqAccordion">
            <div class="card">
              <div class="card-header" id="faq1">
                <h6 class="mb-0">
                  <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse1">
                    如何计算超期罚款？
                  </button>
                </h6>
              </div>
              <div id="collapse1" class="collapse" data-parent="#faqAccordion">
                <div class="card-body">
                  <p>超期罚款按每天0.5元计算，从应还日期次日开始计算，最高不超过图书原价。</p>
                  <p><strong>计算公式：</strong>超期天数 × 0.5元/天 = 罚款金额</p>
                </div>
              </div>
            </div>
            <div class="card">
              <div class="card-header" id="faq2">
                <h6 class="mb-0">
                  <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse2">
                    图书损坏如何赔偿？
                  </button>
                </h6>
              </div>
              <div id="collapse2" class="collapse" data-parent="#faqAccordion">
                <div class="card-body">
                  <p>图书损坏赔偿根据损坏程度评估：</p>
                  <ul>
                    <li><strong>轻度损坏：</strong>修复费用的50%</li>
                    <li><strong>中度损坏：</strong>修复费用的80%</li>
                    <li><strong>重度损坏：</strong>图书原价的80%-100%</li>
                    <li><strong>完全损坏：</strong>图书原价</li>
                  </ul>
                </div>
              </div>
            </div>
            <div class="card">
              <div class="card-header" id="faq3">
                <h6 class="mb-0">
                  <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse3">
                    信用分如何恢复？
                  </button>
                </h6>
              </div>
              <div id="collapse3" class="collapse" data-parent="#faqAccordion">
                <div class="card-body">
                  <p>信用分恢复途径：</p>
                  <ul>
                    <li><strong>时间恢复：</strong>3个月内无新增违规记录，信用分自动恢复</li>
                    <li><strong>志愿服务：</strong>参加图书馆志愿活动，可获得信用加分</li>
                    <li><strong>良好借阅：</strong>连续6个月无逾期记录，可获得信用加分</li>
                    <li><strong>贡献奖励：</strong>荐购被采纳、参与图书馆建设活动，可获得信用加分</li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- 在线缴费模态框 -->
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">在线缴费</h5>
        <button type="button" class="close" data-dismiss="modal">
          <span>&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form id="paymentForm">
          <div class="form-group">
            <label>选择缴费项目</label>
            <div class="list-group" id="paymentItems">
              <!-- 动态生成的缴费项目 -->
            </div>
          </div>
          <div class="form-group">
            <label>支付金额</label>
            <div class="input-group">
              <div class="input-group-prepend">
                <span class="input-group-text">¥</span>
              </div>
              <input type="text" class="form-control" id="paymentAmount" readonly>
            </div>
          </div>
          <div class="form-group">
            <label>支付方式</label>
            <div class="btn-group btn-group-toggle" data-toggle="buttons">
              <label class="btn btn-outline-primary active">
                <input type="radio" name="paymentMethod" value="campus" checked>
                <i class="fas fa-graduation-cap"></i> 校园卡
              </label>
              <label class="btn btn-outline-primary">
                <input type="radio" name="paymentMethod" value="alipay">
                <i class="fab fa-alipay"></i> 支付宝
              </label>
              <label class="btn btn-outline-primary">
                <input type="radio" name="paymentMethod" value="wechat">
                <i class="fab fa-weixin"></i> 微信支付
              </label>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" onclick="processPayment()">
          <i class="fas fa-credit-card"></i> 确认支付
        </button>
      </div>
    </div>
  </div>
</div>

[#include 'inc_footer.html'/]
<script>
// 模拟的静态数据
const finesData = {
  overview: {
    totalAmount: 25.50,
    unpaidCount: 3,
    overdueCount: 1,
    normalCount: 2,
    categories: {
      overdue: 15.00,
      damage: 10.50,
      lost: 0.00,
      other: 0.00
    }
  },
  details: [
    {
      id: 1001,
      type: "OVERDUE",
      typeText: "超期罚款",
      bookTitle: "人工智能基础",
      bookInfo: "索书号：TP18/123 | 作者：张三",
      amount: 15.00,
      generatedDate: "2024-04-10",
      dueDate: "2024-04-20",
      status: "UNPAID",
      statusText: "未缴费",
      daysOverdue: 5,
      dailyFine: 0.50
    },
    {
      id: 1002,
      type: "DAMAGE",
      typeText: "图书损坏",
      bookTitle: "数据结构",
      bookInfo: "索书号：TP311/456 | 作者：李四",
      amount: 10.50,
      generatedDate: "2024-04-05",
      dueDate: "2024-04-25",
      status: "UNPAID",
      statusText: "未缴费",
      damageLevel: "轻度",
      repairCost: 21.00
    }
  ],
  violations: [
    {
      id: 2001,
      type: "OVERDUE_RETURN",
      typeText: "超期未还",
      violationDate: "2024-04-10",
      location: "主校区图书馆",
      bookTitle: "算法导论",
      penaltyPoints: 5,
      status: "RESOLVED",
      statusText: "已处理",
      resolution: "已归还图书并缴纳罚款",
      resolvedDate: "2024-04-15"
    },
    {
      id: 2002,
      type: "BOOK_DAMAGE",
      typeText: "图书污损",
      violationDate: "2024-03-20",
      location: "东校区图书馆",
      bookTitle: "操作系统概念",
      penaltyPoints: 3,
      status: "PROCESSING",
      statusText: "处理中",
      resolution: "等待学生确认赔偿方案"
    }
  ],
  credit: {
    currentScore: 85,
    creditLevel: "B",
    scoreHistory: [
      { date: "2024-04-10", change: -5, reason: "图书超期未还", score: 85 },
      { date: "2024-03-15", change: 3, reason: "志愿服务", score: 90 },
      { date: "2024-02-10", change: -3, reason: "图书损坏", score: 87 }
    ],
    restrictions: {
      maxBorrowCount: 5,
      maxBorrowDays: 20,
      cannotReserve: false,
      specialServices: ["跨校区委托", "外借服务"]
    }
  }
};

// 渲染欠款列表
function renderFineList() {
  const tbody = document.getElementById('fineList');
  tbody.innerHTML = '';

  finesData.details.forEach(fine => {
    const row = document.createElement('tr');
    row.innerHTML =
      '<td>' +
        '<input type="checkbox" class="form-check-input fine-checkbox" value="' + fine.id + '" data-amount="' + fine.amount + '" onchange="updateSelected()">' +
      '</td>' +
      '<td>' +
        '<span class="badge badge-' + getFineTypeColor(fine.type) + '">' + fine.typeText + '</span>' +
      '</td>' +
      '<td>' +
        '<div>' +
          '<strong>' + fine.bookTitle + '</strong><br>' +
          '<small class="text-muted">' + fine.bookInfo + '</small>' +
        '</div>' +
      '</td>' +
      '<td class="text-danger font-weight-bold">¥' + fine.amount.toFixed(2) + '</td>' +
      '<td><small>' + fine.generatedDate + '</small></td>' +
      '<td><small class="' + (fine.status === 'UNPAID' && fine.daysOverdue > 0 ? 'text-warning' : '') + '">' + fine.dueDate + '</small></td>' +
      '<td>' +
        '<span class="badge badge-' + getFineStatusColor(fine.status) + '">' + fine.statusText + '</span>' +
      '</td>' +
      '<td>' +
        '<div class="btn-group btn-group-sm">' +
          '<button type="button" class="btn btn-outline-info" onclick="viewFineDetail(' + fine.id + ')">详情</button>' +
          (fine.status === 'UNPAID' ? '<button type="button" class="btn btn-outline-success" onclick="payFine(' + fine.id + ')">缴费</button>' : '') +
        '</div>' +
      '</td>';
    tbody.appendChild(row);
  });

  // 更新缴费项目
  updatePaymentItems();
}

// 渲染违规列表
function renderViolationList() {
  const tbody = document.getElementById('violationList');
  tbody.innerHTML = '';

  finesData.violations.forEach(violation => {
    const row = document.createElement('tr');
    row.innerHTML =
      '<td>' +
        '<span class="badge badge-' + getViolationTypeColor(violation.type) + '">' + violation.typeText + '</span>' +
      '</td>' +
      '<td><small>' + violation.violationDate + '</small></td>' +
      '<td><small>' + violation.location + '</small></td>' +
      '<td><small>' + violation.resolution + '</small></td>' +
      '<td>' +
        '<div class="progress" style="height: 15px; width: 60px;">' +
          '<div class="progress-bar bg-' + getViolationSeverityColor(violation.penaltyPoints) + '" style="width: ' + getViolationSeverityWidth(violation.penaltyPoints) + '%"></div>' +
        '</div>' +
      '</td>' +
      '<td>' +
        '<span class="badge badge-' + getViolationStatusColor(violation.status) + '">' + violation.statusText + '</span>' +
      '</td>' +
      '<td>' +
        '<div class="btn-group btn-group-sm">' +
          '<button type="button" class="btn btn-outline-info" onclick="viewViolationDetail(' + violation.id + ')">详情</button>' +
          (violation.status === 'RESOLVED' ? '<button type="button" class="btn btn-outline-warning" onclick="appealViolation(' + violation.id + ')">申诉</button>' : '') +
        '</div>' +
      '</td>';
    tbody.appendChild(row);
  });
}

// 获取类型样式
function getFineTypeColor(type) {
  const colorMap = {
    'OVERDUE': 'danger',
    'DAMAGE': 'warning',
    'LOST': 'dark',
    'OTHER': 'secondary'
  };
  return colorMap[type] || 'secondary';
}

function getFineStatusColor(status) {
  const colorMap = {
    'UNPAID': 'danger',
    'PAID': 'success',
    'PARTIAL_PAID': 'warning',
    'WAIVED': 'info'
  };
  return colorMap[status] || 'secondary';
}

function getViolationTypeColor(type) {
  const colorMap = {
    'OVERDUE_RETURN': 'danger',
    'BOOK_DAMAGE': 'warning',
    'SYSTEM_VIOLATION': 'info',
    'BEHAVIOR_VIOLATION': 'secondary'
  };
  return colorMap[type] || 'secondary';
}

function getViolationSeverityColor(points) {
  if (points <= 3) return 'success';
  if (points <= 6) return 'warning';
  return 'danger';
}

function getViolationSeverityWidth(points) {
  return Math.min(points * 10, 100);
}

function getViolationStatusColor(status) {
  const colorMap = {
    'PENDING': 'warning',
    'CONFIRMED': 'info',
    'RESOLVED': 'success',
    'APPEALED': 'danger'
  };
  return colorMap[status] || 'secondary';
}

// 全选/取消全选
function toggleSelectAll() {
  const checkboxes = document.querySelectorAll('.fine-checkbox');
  const selectAll = document.getElementById('selectAll');

  checkboxes.forEach(checkbox => {
    checkbox.checked = selectAll.checked;
  });

  updateSelected();
}

// 更新选择统计
function updateSelected() {
  const checkboxes = document.querySelectorAll('.fine-checkbox:checked');
  let total = 0;

  checkboxes.forEach(checkbox => {
    total += parseFloat(checkbox.dataset.amount);
  });

  document.getElementById('selectedCount').textContent = checkboxes.length;
  document.getElementById('selectedTotal').textContent = `¥${total.toFixed(2)}`;
  updatePaymentAmount(total);
}

// 更新缴费金额
function updatePaymentAmount(amount) {
  document.getElementById('paymentAmount').value = amount.toFixed(2);
}

// 更新缴费项目
function updatePaymentItems() {
  const container = document.getElementById('paymentItems');
  container.innerHTML = '';

  finesData.details.forEach(fine => {
    if (fine.status === 'UNPAID') {
      const item = document.createElement('div');
      item.className = 'list-group-item';
      item.innerHTML =
        '<div class="d-flex justify-content-between">' +
          '<div class="custom-control custom-checkbox">' +
            '<input type="checkbox" class="custom-control-input" value="' + fine.id + '" data-amount="' + fine.amount + '" onchange="updateSelected()">' +
            '<label class="custom-control-label">' + fine.typeText + ' - ' + fine.bookTitle + '</label>' +
          '</div>' +
          '<span class="text-danger">¥' + fine.amount.toFixed(2) + '</span>' +
        '</div>';
      container.appendChild(item);
    }
  });
}

// 功能函数
function filterFines(type) {
  alert('筛选欠款类型：' + type);
  // 这里应该根据类型过滤欠款列表
}

function batchPay() {
  const selectedCount = document.querySelectorAll('.fine-checkbox:checked').length;
  if (selectedCount === 0) {
    alert('请先选择要缴费的项目');
    return;
  }
  showPaymentModal();
}

function exportFines() {
  alert('导出欠款明细为Excel文件');
}

function showPaymentModal() {
  $('#paymentModal').modal('show');
  updatePaymentItems();
}

function processPayment() {
  const selectedItems = document.querySelectorAll('.fine-checkbox:checked');
  if (selectedItems.length === 0) {
    alert('请选择要缴费的项目');
    return;
  }

  alert('处理支付：¥' + document.getElementById('paymentAmount').value);
  // 这里应该跳转到实际的支付网关
}

function viewFineDetail(id) {
  alert('查看欠款详情ID: ' + id);
}

function payFine(id) {
  alert('立即缴费ID: ' + id);
}

function viewViolationDetail(id) {
  alert('查看违规详情ID: ' + id);
}

function appealViolation(id) {
  alert('申诉违规记录ID: ' + id);
}

function selectPaymentMethod(method) {
  alert('选择支付方式：' + method);
}

function saveReminderSettings() {
  alert('缴费提醒设置保存成功！');
}

// 页面初始化
document.addEventListener('DOMContentLoaded', function() {
  renderFineList();
  renderViolationList();
});

// API调用统计
axios.get('${api}/channel/view/${channel.id?c}');
</script>

</body>
</html>
[/#escape]
